package com.ljy.mapper;

import com.ljy.entity.ShopImage;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface ShopImageMapper {
    void insertImage(List<ShopImage> shopImages, Integer goodsId, Short type);

    @Select("select id, image, type, product_id from shop_image where product_id=#{goodsId} and type=#{type}")
    List<ShopImage> selectByProductId(Integer goodsId,Short type);

    @Delete("delete from shop_image where product_id=#{goodsId} and type=#{type}")
    void deleteByProductId(Integer goodsId, Short type);

    void batchDelete(List<Integer> productIds, Short type);
}
